Skip to content

Fix wrong bibo namespace in RDF export - #17842

Merged
Siedlerchr merged 5 commits into
JabRef:mainfrom
dannys2603:fix-8920-bibo-rdf-export
Nov 28, 2026
Merged

Siedlerchr merged 5 commits into
JabRef:mainfrom
dannys2603:fix-8920-bibo-rdf-export

Conversation

@dannys2603

@dannys2603 dannys2603 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The BibO RDF export used the namespace http://purl.org/ontology/biblio/ which doesn't exist (it returns a 404). I changed it to http://purl.org/ontology/bibo/ which is the official BIBO namespace. This is a first step, next i'm planning to update how the authors are exported, and add proper types for books and conference papers, export missing fields like pages and ISBN, and add tests.

Steps to test

  1. Open a library with at least one entry
  2. Go to File > Export > Export all entries
  3. Choose BibO RDF as the format and save it
  4. Open the saved file and check the xmlns:bibo line at the top
  5. It should now say xmlns:bibo="http://purl.org/ontology/bibo/"

Related issues and pull requests

Closes #8920

AI usage

I used Claude (Opus 5.5) to:

  • help me understand the issue and RDF
  • find the correct BIBO namespace
  • set up JabRef on my Mac

I made the code change myself.
AIL2

Checklist

  • I own the copyright of the code submitted and I license it under the MIT license
  • If AI tools were used, I disclosed them in the "AI usage" section and reviewed, understood, and take full ownership of all AI-generated code
  • I manually tested my changes in running JabRef (always required)
  • I added JUnit tests for changes (if applicable)
  • [/] I added screenshots in the PR description (if change is visible to the user)
  • I added one sentence (max 20 words) to CHANGELOG.md describing the change from the user's point of view (if the change is visible to the user)
  • I checked the user documentation for up to dateness and submitted a pull request to our user documentation repository

@github-actions

Copy link
Copy Markdown
Contributor

Hey @dannys2603! 👋

Thank you for contributing to JabRef!

We have automated checks in place, based on which you will soon get feedback if any of them are failing. We also use Qodo for review assistance. It will update your pull request description with a review help and offer suggestions to improve the pull request.

After all automated checks pass, a maintainer will also review your contribution. Once that happens, you can go through their comments in the "Files changed" tab and act on them, or reply to the conversation if you have further inputs. You can read about the whole pull request process in our contribution guide.

Please ensure that your pull request is in line with our AI Usage Policy and make necessary disclosures.

@jabref-machine jabref-machine added the dev: send-to-black-forest Port to the black-forest branch of JabRef/jabref-black-forest after merging (ADR-0073) label Nov 17, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow up maybe: AuthorListParser.

Comment on lines -37 to -43
sb.append("<bibo:contribution>\n");
sb.append(" <bibo:Contribution>\n");
sb.append(" <bibo:role rdf:resource=\"http://purl.org/ontology/bibo/roles/author\" />\n");
sb.append(" <bibo:contributor><foaf:Person foaf:name=\"").append(author).append("\"/></bibo:contributor>\n");
sb.append(" <bibo:position>").append(position).append("</bibo:position>\n");
sb.append(" </bibo:Contribution>\n");
sb.append("</bibo:contribution>\n");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we use bibo?

What about dublin core at the other places? Relation to PdfMetaDataImporter?

(Sorry for that, but if we are in the context of these namespaces, we should check)

@@ -2,7 +2,7 @@
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:bibo="http://purl.org/ontology/biblio/"
xmlns:bibo="http://purl.org/ontology/bibo/"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the other hand, if this is the rigth namespace now, we should just merge and fix other things later.

koppor
koppor previously approved these changes Nov 23, 2026
@koppor koppor added the status: awaiting-second-review For non-trivial changes label Nov 23, 2026
@koppor
koppor requested a review from Siedlerchr November 23, 2026 21:07
@koppor
koppor marked this pull request as ready for review November 23, 2026 21:07
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Correct BibO RDF namespace and export authors as creators

🐞 Bug fix 🕐 10-20 Minutes

Grey Divider

AI Description

• Use the official BibO namespace in RDF exports instead of the incorrect URI.
• Export authors as Dublin Core creators rather than BibO contributions.
Merge Risk 🟡 Medium

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The changed formatter is wired into both document and article BibO RDF templates, and the exporter registration selects this template for the end-to-end RDF export behavior.
  • These are two entry templates for the same author-metadata integration, not independent capabilities.
Sources

jablib/src/main/resources/resource/layout/bibordf.article.layout[11-11]

   \format[CreateBibORDFAuthors]{\author}

jablib/src/main/java/org/jabref/logic/layout/format/CreateBibORDFAuthors.java[16-18]

        AuthorList authors = AuthorList.parse(fieldText);
        if (authors.isEmpty()) {
            return "";

jablib/src/main/resources/resource/layout/bibordf.layout[8-8]

   \format[CreateBibORDFAuthors]{\author}

jablib/src/main/java/org/jabref/logic/exporter/ExporterFactory.java[43-43]

        exporters.add(new TemplateExporter("BibO RDF", "bibordf", "bibordf", "", StandardFileType.RDF, layoutPreferences, saveOrder));
Behavioral complexity 🟡 Medium 🧩 Compatibility cases, Interacting branches

  • Before, the formatter emitted per-author bibo contributions and split raw text directly.
  • After, it parses AuthorList data, emits direct creators and an ordered sequence, and changes the BIBO namespace.
  • New correctness conditions are preserving parsed author order, escaping names, sharing each creator's generated node identifier with exactly one sequence member, and maintaining compatibility across consumers reading either representation.
  • The interaction is introduced by the dual creator/list representation; UUID generation itself is routine.
Sources

jablib/src/main/java/org/jabref/logic/layout/format/CreateBibORDFAuthors.java[16-18]

        AuthorList authors = AuthorList.parse(fieldText);
        if (authors.isEmpty()) {
            return "";

jablib/src/main/resources/resource/layout/bibordf.begin.layout[5-7]

      xmlns:bibo="http://purl.org/ontology/bibo/"
      xmlns:dc="http://purl.org/dc/elements/1.1/"
      xmlns:dcterms="http://purl.org/dc/terms/"
Potential damage 🟡 Medium 🩹 Incorrect results

  • If the changed serialization regresses, exported RDF can contain missing, malformed, misordered, or semantically incompatible author metadata.
  • The affected behavior is the BibO RDF author export itself; no repository-local downstream consumer was found.
  • Reverting the code prevents new incorrect exports, but already generated RDF files must be regenerated.
  • External systems that already imported incorrect metadata may require replacement or manual repair; no automatic repair path is shown.
Sources

jablib/src/main/java/org/jabref/logic/layout/format/CreateBibORDFAuthors.java[16-18]

        AuthorList authors = AuthorList.parse(fieldText);
        if (authors.isEmpty()) {
            return "";

jablib/src/main/resources/resource/layout/bibordf.begin.layout[5-7]

      xmlns:bibo="http://purl.org/ontology/bibo/"
      xmlns:dc="http://purl.org/dc/elements/1.1/"
      xmlns:dcterms="http://purl.org/dc/terms/"

jablib/src/main/java/org/jabref/logic/exporter/ExporterFactory.java[43-43]

        exporters.add(new TemplateExporter("BibO RDF", "bibordf", "bibordf", "", StandardFileType.RDF, layoutPreferences, saveOrder));
Assessed commit b0dd75d
Diagram

graph TD
  A["Bib entries"] --> B["BibO layouts"] --> C["Author formatter"] --> D["RDF document"]
  B --> E["Namespace header"] --> D
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Emit creators alongside contributions
  • ➕ Retains explicit author roles and positions for consumers that use them.
  • ➖ Duplicates author relationships and preserves the contribution structure this change aims to replace.

Recommendation: Use the PR's direct namespace correction and dcterms:creator mapping for this focused fix. Review whether losing explicit author positions is acceptable for BibO RDF consumers before merging.

Files changed (2) +2 / -8

Bug fix (2) +2 / -8
CreateBibORDFAuthors.javaEmit RDF authors as Dublin Core creators +1/-7

Emit RDF authors as Dublin Core creators

• Replaces each nested BibO contribution with a dcterms:creator containing a FOAF person. The output no longer includes an explicit author role or position.

jablib/src/main/java/org/jabref/logic/layout/format/CreateBibORDFAuthors.java

bibordf.begin.layoutCorrect the BibO namespace declaration +1/-1

Correct the BibO namespace declaration

• Changes the RDF export header from the incorrect biblio URI to the official http://purl.org/ontology/bibo/ namespace.

jablib/src/main/resources/resource/layout/bibordf.begin.layout

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

📘 Rule violations (1)

Grey Divider


Remediation recommended

1. Exporter test builds a real preferences object 📘 Rule violation
Description
The new BibORdfExporterTest passes LayoutFormatterPreferences.getDefault() into the
TemplateExporter constructor, so the test uses a real preferences instance instead of a mock.
Because the test is coupled to whatever default values that factory returns, a change to those
defaults can alter the exported output and break the test for reasons unrelated to the BibO export
logic.
Code

jablib/src/test/java/org/jabref/logic/exporter/BibORdfExporterTest.java[R46-47]

+        var exporter = new TemplateExporter("BibO RDF", "bibordf", "bibordf", "", StandardFileType.RDF,
+                LayoutFormatterPreferences.getDefault(), SaveOrder.getDefaultSaveOrder());
Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The test `BibORdfExporterTest.exportsOrderedAuthors` constructs a real `LayoutFormatterPreferences` via `LayoutFormatterPreferences.getDefault()`. Tests must mock Preferences classes instead of constructing real instances.
## Fix Focus Areas
- jablib/src/test/java/org/jabref/logic/exporter/BibORdfExporterTest.java[46-47]
## Recommended Fix
Replace `LayoutFormatterPreferences.getDefault()` in the `new TemplateExporter(...)` call with a Mockito mock, e.g. `mock(LayoutFormatterPreferences.class)`, and stub only the getters that the BibO RDF template path reads. Add the static import `org.mockito.Mockito.mock` and the matching import for `LayoutFormatterPreferences` if it is not already present.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Resolved findings
1. Exported authors lose their order ✓ Resolved Medium
Description
singleAuthor now emits only a dcterms:creator assertion and ignores the position passed for
each author. For entries with multiple authors, their sequence remains visible in the XML text but
is no longer represented in the RDF graph, so graph consumers cannot reliably recover the original
order.

Grey Divider

Tip of the day
💡 Did you know, you can turn these tips off under Display > Comment parts

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@github-actions github-actions Bot added size: medium status: changes-required Pull requests that are not yet complete and removed size: small labels Nov 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The requested changes were not addressed for 3 days. Please follow-up in the next 7 days or your PR will be automatically closed. You can check the contributing guidelines for hints on the pull request process.

@github-actions github-actions Bot added the status: stale Issues marked by a bot as "stale". All issues need to be investigated manually. label Nov 28, 2026
* main: (202 commits)
  New Crowdin updates (JabRef#17956)
  chore(deps): update dependency com.konghq:unirest-modules-gson to v4.12.4 (JabRef#17955)
  Let Renovate update JavaFX in the jabsrv launcher (JabRef#17954)
  chore(deps): update dependency com.konghq:unirest-modules-gson to v4.12.3 (JabRef#17953)
  Import the RIS serial number of books and chapters as ISBN (JabRef#17891)
  Share nested LaTeX conversion with Writer (JabRef#17921)
  Render BST preview italics and bold as text, not math letters (JabRef#17902)
  Chore(deps): Bump com.konghq:unirest-java-bom from 4.11.11 to 4.12.0 in /versions (JabRef#17951)
  Inject NativeDesktop into its callers and remove the deprecated static helpers (JabRef#17947)
  New Crowdin updates (JabRef#17945)
  Chore(deps): Bump org.graalvm.sdk:nativeimage from 25.5.5.0.3 to 25.6.5.1 in /versions (JabRef#17944)
  Chore(deps): Bump com.googlecode.plist:dd-plist from 1.30 to 1.31 in /versions (JabRef#17943)
  Chore(deps): Bump JetBrains/junie-github-action from 1.10.1 to 1.10.2 (JabRef#17942)
  Chore(deps): Bump softprops/action-gh-release from 3.0.3 to 3.0.4 (JabRef#17941)
  Chore(deps): Bump anthropics/claude-code-action from 1.0.286 to 1.0.289 (JabRef#17940)
  Chore(deps): Bump ruby/setup-ruby from 1.343.0 to 1.344.0 (JabRef#17939)
  Update dependency com.konghq:unirest-modules-gson to v4.12.0 (JabRef#17937)
  [Bot] Update SBOM files (JabRef#17934)
  Chore(deps): Bump jablib/src/main/resources/csl-styles from `af0aea3` to `7fa488b` (JabRef#17928)
  Chore(deps): Bump jablib/src/main/resources/csl-locales from `8bef426` to `21a175a` (JabRef#17927)
  ...
@github-actions github-actions Bot removed status: changes-required Pull requests that are not yet complete status: stale Issues marked by a bot as "stale". All issues need to be investigated manually. labels Nov 28, 2026
@Siedlerchr
Siedlerchr enabled auto-merge November 28, 2026 13:27
@Siedlerchr
Siedlerchr added this pull request to the merge queue Nov 28, 2026
@github-actions github-actions Bot removed the status: awaiting-second-review For non-trivial changes label Nov 28, 2026
@github-actions github-actions Bot added the status: to-be-merged PRs which are accepted and should go into the merge-queue. label Nov 28, 2026
@dannys2603

Copy link
Copy Markdown
Contributor Author

Thanks @koppor and @Siedlerchr for reviewing this and for sorting out the author order and the code style.

I'll do the rest of my plan in a follow-up PR, adding proper types for books and conference papers, exporting missing fields like pages and ISBN, and adding tests.

Merged via the queue into JabRef:main with commit 9b103cd Nov 28, 2026
80 checks passed
@jabref-machine

Copy link
Copy Markdown
Collaborator

Successfully created backport PR for black-forest:

@github-actions github-actions Bot added the status: changes-required Pull requests that are not yet complete label Nov 28, 2026
bhosale-mahesh pushed a commit to bhosale-mahesh/jabref that referenced this pull request Nov 29, 2026
### Summary
The BibO RDF export used the namespace http://purl.org/ontology/biblio/
which doesn't exist (it returns a 404). I changed it to
http://purl.org/ontology/bibo/ which is the official BIBO namespace.
This is a first step, next i'm planning to update how the authors are
exported, and add proper types for books and conference papers, export
missing fields like pages and ISBN, and add tests.

### Steps to test

1. Open a library with at least one entry
2. Go to File > Export > Export all entries
3. Choose BibO RDF as the format and save it
4. Open the saved file and check the xmlns:bibo line at the top
5. It should now say xmlns:bibo="http://purl.org/ontology/bibo/"

### Related issues and pull requests

Closes JabRef#8920

### AI usage

I used Claude (Opus 5.5) to:

- help me understand the issue and RDF
- find the correct BIBO namespace
- set up JabRef on my Mac

I made the code change myself.
AIL2

### Checklist

- [x] I own the copyright of the code submitted and I license it under
the [MIT license](https://github.com/JabRef/jabref/blob/main/LICENSE)
- [x] If AI tools were used, I disclosed them in the "AI usage" section
and reviewed, understood, and take full ownership of all AI-generated
code
- [x] I manually tested my changes in running JabRef (always required)
- [ ] I added JUnit tests for changes (if applicable)
- [/] I added screenshots in the PR description (if change is visible to
the user)
- [ ] I added **one sentence (max 20 words)** to `CHANGELOG.md`
describing the change from the user's point of view (if the change is
visible to the user)
- [ ] I checked the [user documentation](https://docs.jabref.org/) for
up to dateness and submitted a pull request to our [user documentation
repository](https://github.com/JabRef/user-documentation/tree/main/en)

---------

Co-authored-by: Siedlerchr <siedlerkiller@gmail.com>
Siedlerchr added a commit to PedroSarmento2007/jabref that referenced this pull request Nov 29, 2026
* main: (35 commits)
  Fix author and editor name export in MODS format (JabRef#17936)
  Fix LaTeX conversion in exported PDF metadata (JabRef#17810)
  Fix preferences menu text (JabRef#17966)
  Skip forced full-text index merges on shutdown (JabRef#17961)
  Fix wrong bibo namespace in RDF export (JabRef#17842)
  New Crowdin updates (JabRef#17956)
  chore(deps): update dependency com.konghq:unirest-modules-gson to v4.12.4 (JabRef#17955)
  Let Renovate update JavaFX in the jabsrv launcher (JabRef#17954)
  chore(deps): update dependency com.konghq:unirest-modules-gson to v4.12.3 (JabRef#17953)
  Import the RIS serial number of books and chapters as ISBN (JabRef#17891)
  Share nested LaTeX conversion with Writer (JabRef#17921)
  Render BST preview italics and bold as text, not math letters (JabRef#17902)
  Chore(deps): Bump com.konghq:unirest-java-bom from 4.11.11 to 4.12.0 in /versions (JabRef#17951)
  Inject NativeDesktop into its callers and remove the deprecated static helpers (JabRef#17947)
  New Crowdin updates (JabRef#17945)
  Chore(deps): Bump org.graalvm.sdk:nativeimage from 25.5.5.0.3 to 25.6.5.1 in /versions (JabRef#17944)
  Chore(deps): Bump com.googlecode.plist:dd-plist from 1.30 to 1.31 in /versions (JabRef#17943)
  Chore(deps): Bump JetBrains/junie-github-action from 1.10.1 to 1.10.2 (JabRef#17942)
  Chore(deps): Bump softprops/action-gh-release from 3.0.3 to 3.0.4 (JabRef#17941)
  Chore(deps): Bump anthropics/claude-code-action from 1.0.286 to 1.0.289 (JabRef#17940)
  ...
Siedlerchr added a commit to gourprince222/jabref that referenced this pull request Nov 29, 2026
* main: (58 commits)
  Keep organization authors containing "and" intact in RIS export. (JabRef#17876)
  Fix author and editor name export in MODS format (JabRef#17936)
  Fix LaTeX conversion in exported PDF metadata (JabRef#17810)
  Fix preferences menu text (JabRef#17966)
  Skip forced full-text index merges on shutdown (JabRef#17961)
  Fix wrong bibo namespace in RDF export (JabRef#17842)
  New Crowdin updates (JabRef#17956)
  chore(deps): update dependency com.konghq:unirest-modules-gson to v4.12.4 (JabRef#17955)
  Let Renovate update JavaFX in the jabsrv launcher (JabRef#17954)
  chore(deps): update dependency com.konghq:unirest-modules-gson to v4.12.3 (JabRef#17953)
  Import the RIS serial number of books and chapters as ISBN (JabRef#17891)
  Share nested LaTeX conversion with Writer (JabRef#17921)
  Render BST preview italics and bold as text, not math letters (JabRef#17902)
  Chore(deps): Bump com.konghq:unirest-java-bom from 4.11.11 to 4.12.0 in /versions (JabRef#17951)
  Inject NativeDesktop into its callers and remove the deprecated static helpers (JabRef#17947)
  New Crowdin updates (JabRef#17945)
  Chore(deps): Bump org.graalvm.sdk:nativeimage from 25.5.5.0.3 to 25.6.5.1 in /versions (JabRef#17944)
  Chore(deps): Bump com.googlecode.plist:dd-plist from 1.30 to 1.31 in /versions (JabRef#17943)
  Chore(deps): Bump JetBrains/junie-github-action from 1.10.1 to 1.10.2 (JabRef#17942)
  Chore(deps): Bump softprops/action-gh-release from 3.0.3 to 3.0.4 (JabRef#17941)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: export-or-save dev: send-to-black-forest Port to the black-forest branch of JabRef/jabref-black-forest after merging (ADR-0073) first contrib size: medium status: changes-required Pull requests that are not yet complete status: to-be-merged PRs which are accepted and should go into the merge-queue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RDF export uses bad URI for namespace 'bibo'

4 participants